package com.shbt.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TBookType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_book_type", catalog = "default_schema")
public class TBookType implements java.io.Serializable {

	// Fields

	private Integer id;
	private String bookTypeCode;
	private String typeName;
	private Set<TReleaseSell> TReleaseSells = new HashSet<TReleaseSell>(0);

	// Constructors

	/** default constructor */
	public TBookType() {
	}

	/** minimal constructor */
	public TBookType(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public TBookType(Integer id, String bookTypeCode, String typeName,
			Set<TReleaseSell> TReleaseSells) {
		this.id = id;
		this.bookTypeCode = bookTypeCode;
		this.typeName = typeName;
		this.TReleaseSells = TReleaseSells;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "book_type_code", length = 20)
	public String getBookTypeCode() {
		return this.bookTypeCode;
	}

	public void setBookTypeCode(String bookTypeCode) {
		this.bookTypeCode = bookTypeCode;
	}

	@Column(name = "type_name", length = 20)
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TBookType")
	public Set<TReleaseSell> getTReleaseSells() {
		return this.TReleaseSells;
	}

	public void setTReleaseSells(Set<TReleaseSell> TReleaseSells) {
		this.TReleaseSells = TReleaseSells;
	}

}